<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="<%=request.getContextPath() %>/resources/css/admin/basic.css" type="text/css"/>
<link rel="stylesheet" href="<%=request.getContextPath() %>/resources/css/admin/index.css" type="text/css"/>
<link rel="stylesheet" href="<%=request.getContextPath() %>/resources/css/admin/table1.css" type="text/css"/>
<link rel="stylesheet" href="<%=request.getContextPath() %>/resources/css/icon.css" type="text/css"/>
<script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/main.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/admin/jquery.admintable.js"></script><script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/public/jquery.confirmdialog.js"></script><script type="text/javascript">
$(function(){
	$("#admintable").admintable();
    $("a[oper='delete']").confirmdialog();

});
function doExport(){
    document.getElementById("mainForm").action="<%=request.getContextPath() %>/seller/deleteGoodsChecked";
    document.getElementById("mainForm").submit();
}
function display(){
    document.getElementById("mainForm").action="<%=request.getContextPath() %>/seller/goods/backSearch";
    document.getElementById("mainForm").submit();
}
</script>
</head>
<body>
<div class="main_content_container">

    <form method="post" id="mainForm">
	<table id="admintable" cellpadding="0" cellspacing="0">

        <thead>
        <tr>
            <td  colspan="10" class="title">
                <ul class="function_menu">

                    <li id="select"> <input type="text" name="name" size="30"/> </li>
                    <li><a href="#" onclick="display()"><span class="icon16 icon-search"></span>查询</a></li>
                    <%--<li><a href="#" onclick="display()"><span class="icon16 icon-search"></span>查询</a></li>--%>
                    <li><a href="<%=request.getContextPath()%>//seller/goods/add">增加</a></li>
                    <li><a onclick="doExport()" oper="delete" ><span class="icon16 icon-cancel"></span>删除</a></li>
                </ul>
            </td>
        </tr>
        </thead>

        <tr showCheck="1">
            <td objId="1"  align="center"><strong>商品编号</strong></td>
            <td  align="center"><strong>图片</strong></td>
            <td  align="center"><strong>商品品牌</strong></td>
            <td  align="center"><strong>商品名称</strong></td>
            <td  align="center"><strong>价格</strong></td>
            <td  align="center"><strong>描述</strong></td>
            <td  align="center"><strong>库存</strong></td>
            <td  align="center"><strong>已售</strong></td>
            <td  align="center"><strong>用户操作</strong></td>
        </tr>


        <tbody>
        <c:forEach items="${goodsList.datas }" var="goods">
            <tr>
                <td objId="${goods.id}" align="center">${goods.id}</td>
                <td align="center"><image src="<%=request.getContextPath()%>/resources/images/goodsImages/${goods.image}" height="100px" width="100px"/></td>
                <td align="center">${goods.brand}</td>
                <td align="center"><a href="<%=request.getContextPath() %>/seller/goodsDetail/${goods.id }" class="list_link">${goods.name }</a></td>
                <td align="center">${goods.price }</td>
                <td align="center">${goods.describer }</td>
                <td align="center">${goods.stock}</td>
                <td align="center">${goods.uptime}</td>

                <td align="center">
                    <c:if test="${goods.status eq 0 }">
                        <a href="<%=request.getContextPath() %>/seller/goods/${goods.id }/updateStatus/2" class="list_op">删除</a>
                    </c:if>
                    <c:if test="${goods.status eq 1 }">
                        <a href="<%=request.getContextPath() %>/seller/goods/${goods.id }/updateStatus/3" class="list_op">下架</a>
                    </c:if>
                    <c:if test="${goods.status eq 2 }">
                        <a href="<%=request.getContextPath() %>/seller/goods/${goods.id }/updateStatus/2" class="list_op">删除</a>
                    </c:if>
                    <c:if test="${goods.status eq 3 }">
                        <a href="<%=request.getContextPath() %>/seller/goods/${goods.id }/updateStatus/1" class="list_op">上架</a>
                    </c:if>
                    &nbsp;
                    <a href="<%=request.getContextPath() %>/seller/goods/${goods.id }/update" title="${goods.id }" class="name">修改</a>
                </td>

            </tr>
        </c:forEach>
        </tbody>

	  	<tfoot>
	  	<tr>
		    <td colspan="10">
                <jsp:include page="/jsp/public/pager.jsp">
                    <jsp:param value="${goodsList.total }" name="totalRecord"/>
                    <jsp:param value="goodsList" name="url"/>
                    <jsp:param value="0" name="status"/>
                </jsp:include>
		    </td>
	    </tr>
	    </tfoot>


	</table>
    </form>
   </div>
</div>
</body>
</html>